import React, {PureComponent} from "react";
import {Button, DatePicker, TimePicker} from "antd";
import {Map} from "react-amap";
import {AMapKey} from "../common/Contants";


class RecordRideRouteComponent extends PureComponent {

    constructor(props) {
        super(props);
        this.state = {
            durationTime: [],
            plugins: [
                'Scale',
                {
                    name: 'ToolBar',
                    options: {
                        visible: false,  // 不设置该属性默认就是 true
                    },
                }
            ],
            mapCenter: {longitude: 135, latitude: 30},
        }
    };


    render() {

        console.log("车辆骑行记录 测试");
        console.log(this.props.test);

        return (
            <div style={recordCenterStyle}>

                <div>
                    <DatePicker
                        onChange={this.onchange}
                    />

                    <TimePicker/>至 <TimePicker/>
                    <Button htmlType={"button"}>确定</Button>
                </div>

                <div style={{height:300}}>
                    <Map
                        amapkey={AMapKey}
                        plugins={this.state.plugins}
                        center={this.state.mapCenter}
                    >
                    </Map>
                </div>
            </div>
        )
    }

    onOk() {
        console.log("点击 onOk");
    }

    onchange() {

    }


}

export default RecordRideRouteComponent;


const recordCenterStyle = {
    width: "100%",
    height: "100%",
    backgroundColor: "pink",
};